package GUI;

/*********************************************
* Un squelette de serveur TCP Multi-Processus.
* Yann & JC
* INSA TOULOUSE
**********************************************/
import java.net.Socket;
import java.io.*;
import Serveur.ComunicaTCPServer;

public class ThreadTCP extends AbstractThread {

	Comunica x;
	ComunicaTCPServer serveur;
        
	ThreadTCP(Socket client,ComunicaTCPServer serveur)
	{
		super(client); 
		this.serveur=serveur;
	}
        
	ThreadTCP(Socket client,ComunicaTCPServer serveur,Comunica z)
	{
		super(client); 
		this.serveur=serveur;
		this.x=z;
	}

        ///////////////////////////////////////////////
        ///////////////////////////////////////////////
         ThreadTCP(Socket client)
        {
            super(client);
        }
        ///////////////////////////////////////////////
        ///////////////////////////////////////////////
         public void startProtocol() throws Exception
        {    
            while(true)
            {
		String s=in.readLine();
		if(s == null) break;
		System.out.println(s);
		/*for(ThreadTCP c:serveur.clients)
		{
			if(c == this) continue;
			System.out.println("Envoi vers: " +c.sock);
			c.out.println(s);
		}*/
	}
  }
 
  public void close( )
  {
	//serveur.clients.remove(this);
	super.close(); 
  }


}
